package com.googlecode.stemwijzer.client.inject;

import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.gin.AbstractPresenterModule;
import net.customware.gwt.presenter.client.place.PlaceManager;

import com.google.inject.Singleton;
import com.googlecode.stemwijzer.client.StemwijzerServiceAsync;
import com.googlecode.stemwijzer.client.presenter.AnswerQuestionPresenter;
import com.googlecode.stemwijzer.client.presenter.NotificationPresenter;
import com.googlecode.stemwijzer.client.presenter.RegistrationPresenter;
import com.googlecode.stemwijzer.client.presenter.ResultsPresenter;
import com.googlecode.stemwijzer.client.presenter.StemwijzerPresenter;
import com.googlecode.stemwijzer.client.view.AnswerQuestionView;
import com.googlecode.stemwijzer.client.view.NotificationView;
import com.googlecode.stemwijzer.client.view.RegistrationView;
import com.googlecode.stemwijzer.client.view.ResultsView;
import com.googlecode.stemwijzer.client.view.StemwijzerView;

public class StemwijzerModule extends AbstractPresenterModule {

	@Override
	protected void configure() {
		bind(StemwijzerServiceAsync.class).in(Singleton.class);

		bind(EventBus.class).to(DefaultEventBus.class).in(Singleton.class);
		bind(PlaceManager.class).in(Singleton.class);

		bindPresenter(StemwijzerPresenter.class,
				StemwijzerPresenter.Display.class, StemwijzerView.class);
		bindPresenter(RegistrationPresenter.class,
				RegistrationPresenter.Display.class, RegistrationView.class);
		bindPresenter(AnswerQuestionPresenter.class,
				AnswerQuestionPresenter.Display.class, AnswerQuestionView.class);
		bindPresenter(ResultsPresenter.class, ResultsPresenter.Display.class,
				ResultsView.class);
		bindPresenter(NotificationPresenter.class,
				NotificationPresenter.Display.class, NotificationView.class);
	}
}
